import javax.swing.JApplet;
import javax.swing.JFrame;

import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;



public class DeskMaster extends JApplet implements MouseInputListener, MouseWheelListener {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	int variable;
	int iX,iY,iCount,iButton,iRotation;
		 
	public void paint(Graphics g) {
		g.clearRect(0, 0, 200, 200);
		g.drawRect(0, 0, 
		   getSize().width - 1,
		   getSize().height - 1);
        g.drawString(""+ variable, 5, 15);
    }
	
	public void init(){
		addMouseMotionListener(this);
		addMouseListener(this);
		addMouseWheelListener(this);
	}
	
    public void mousePressed(MouseEvent e) {
    	iButton=e.getButton();
    }
	
    public void mouseReleased(MouseEvent e) {
    	iButton=e.getButton();
    }

    public void mouseEntered(MouseEvent e) {
        
    }

    public void mouseExited(MouseEvent e) {
        
    }

    public void mouseClicked(MouseEvent e) {
        iCount=e.getClickCount();
        iButton=e.getButton();
    }
    
    public void mouseMoved(MouseEvent e) {
    	iX=getX();
        iY=getY();
    }
    
    public void mouseDragged(MouseEvent e) {
        iButton=e.getButton(); 
        iX=getX();
        iY=getY();
    }
    
    public void mouseWheelMoved(MouseWheelEvent e){
    	 iRotation=e.getWheelRotation();
    }
       
}
 

